package com.iv.durian.cloud.service;

import com.iv.durian.cloud.Student;
import com.iv.durian.cloud.dao.StudentDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StudentService {

    @Autowired
    private StudentDao studentDao;

    public Student get(Integer id) { return studentDao.get(id,null,null,null); }
    public Student get(String name){return studentDao.get(null,null,name,null); }

    public int add(Student student) {return studentDao.add(student); }

    public int update(Student student) {return studentDao.update(student); }

    public int remove(Integer id) {return studentDao.remove(id); }

    public int count(Integer id) {
        return studentDao.count(id);
    }

    public List<Student> list(Integer id, int offset, int limit){
        return studentDao.list(id,offset,limit);
    }

}
